home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / u_man / cat1 / perlpod.Z / perlpod
Encoding:
Text File  |  1998-10-28  |  12.4 KB  |  397 lines

  1.  
  2.  
  3.  
  4.      PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))        PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       perlpod - plain old documentation
  10.  
  11.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.       A pod-to-whatever translator reads a pod file    paragraph by
  13.       paragraph, and translates it to the appropriate output
  14.       format.  There are three kinds of paragraphs:     verbatim,
  15.       command, and ordinary    text.
  16.  
  17.       VVVVeeeerrrrbbbbaaaattttiiiimmmm PPPPaaaarrrraaaaggggrrrraaaapppphhhh
  18.  
  19.       A verbatim paragraph,    distinguished by being indented    (that
  20.       is, it starts    with space or tab).  It    should be reproduced
  21.       exactly, with    tabs assumed to    be on 8-column boundaries.
  22.       There    are no special formatting escapes, so you can't
  23.       italicize or anything    like that.  A \    means \, and nothing
  24.       else.
  25.  
  26.       CCCCoooommmmmmmmaaaannnndddd PPPPaaaarrrraaaaggggrrrraaaapppphhhh
  27.  
  28.       All command paragraphs start with "=", followed by an
  29.       identifier, followed by arbitrary text that the command can
  30.       use however it pleases.  Currently recognized    commands are
  31.  
  32.           =head1 heading
  33.           =head2 heading
  34.           =item text
  35.           =over N
  36.           =back
  37.           =cut
  38.           =pod
  39.           =for X
  40.           =begin X
  41.           =end X
  42.  
  43.  
  44.       =pod
  45.  
  46.       =cut
  47.           The "=pod" directive does    nothing    beyond telling the
  48.           compiler to lay off parsing code through the next
  49.           "=cut".  It's useful for adding another paragraph    to the
  50.           doc if you're mixing up code and pod a lot.
  51.  
  52.       =head1
  53.  
  54.       =head2
  55.           Head1 and    head2 produce first and    second level headings,
  56.           with the text in the same    paragraph as the "=headn"
  57.           directive    forming    the heading description.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))        PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))
  71.  
  72.  
  73.  
  74.       =over
  75.  
  76.       =back
  77.  
  78.       =item
  79.           Item, over, and back require a little more explanation:
  80.           "=over" starts a section specifically for    the generation
  81.           of a list    using "=item" commands.    At the end of your
  82.           list, use    "=back"    to end it. You will probably want to
  83.           give "4" as the number to    "=over", as some formatters
  84.           will use this for    indentation.  This should probably be
  85.           a    default. Note also that    there are some basic rules to
  86.           using =item: don't use them outside of an    =over/=back
  87.           block, use at least one inside an    =over/=back block, you
  88.           don't _have_ to include the =back    if the list just runs
  89.           off the document,    and perhaps most importantly, keep the
  90.           items consistent:    either use "=item *" for all of    them,
  91.           to produce bullets, or use "=item    1.", "=item 2.", etc.,
  92.           to produce numbered lists, or use    "=item foo", "=item
  93.           bar", etc., i.e.,    things that looks nothing like bullets
  94.           or numbers. If you start with bullets or numbers,    stick
  95.           with them, as many formatters use    the first "=item" type
  96.           to decide    how to format the list.
  97.  
  98.       =for
  99.  
  100.       =begin
  101.  
  102.       =end
  103.           For, begin, and end let you include sections that    are
  104.           not interpreted as pod text, but passed directly to
  105.           particular formatters. A formatter that can utilize that
  106.           format will use the section, otherwise it    will be
  107.           completely ignored.  The directive "=for"    specifies that
  108.           the entire next paragraph    is in the format indicated by
  109.           the first    word after "=for", like    this:
  110.  
  111.            =for html <br>
  112.         <p> This is a raw HTML paragraph </p>
  113.  
  114.           The paired commands "=begin" and "=end" work very
  115.           similarly    to "=for", but instead of only accepting a
  116.           single paragraph,    all text from "=begin" to a paragraph
  117.           with a matching "=end" are treated as a particular
  118.           format.
  119.  
  120.           Here are some examples of    how to use these:
  121.  
  122.            =begin html
  123.  
  124.            <br>Figure 1.<IMG SRC="figure1.png"><br>
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))        PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))
  137.  
  138.  
  139.  
  140.            =end html
  141.  
  142.            =begin text
  143.  
  144.          ---------------
  145.          |  foo           |
  146.          |      bar  |
  147.          ---------------
  148.  
  149.            ^^^^ Figure 1. ^^^^
  150.  
  151.            =end text
  152.  
  153.           Some format names    that formatters    currently are known to
  154.           accept include "roff", "man", "latex", "tex", "text",
  155.           and "html". (Some    formatters will    treat some of these as
  156.           synonyms.)
  157.  
  158.           And don't    forget,    when using any command,    that the
  159.           command lasts up until the end of    the ppppaaaarrrraaaaggggrrrraaaapppphhhh, not the
  160.           line. Hence in the examples below, you can see the empty
  161.           lines after each command to end its paragraph.
  162.  
  163.           Some examples of lists include:
  164.  
  165.            =over 4
  166.  
  167.            =item *
  168.  
  169.            First item
  170.  
  171.            =item *
  172.  
  173.            Second item
  174.  
  175.            =back
  176.  
  177.            =over 4
  178.  
  179.            =item Foo()
  180.  
  181.            Description of Foo function
  182.  
  183.            =item Bar()
  184.  
  185.            Description of Bar function
  186.  
  187.            =back
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                        (printed 10/23/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))        PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))
  203.  
  204.  
  205.  
  206.       OOOOrrrrddddiiiinnnnaaaarrrryyyy BBBBlllloooocccckkkk ooooffff TTTTeeeexxxxtttt
  207.  
  208.       It will be filled, and maybe even justified.    Certain
  209.       interior sequences are recognized both here and in commands:
  210.  
  211.           I<text>      italicize text, used for emphasis or variables
  212.           B<text>      embolden text, used for switches and programs
  213.           S<text>      text contains    non-breaking spaces
  214.           C<code>      literal code
  215.           L<name>      A link (cross    reference) to name
  216.                   L<name>          manual page
  217.                   L<name/ident>      item in manual page
  218.                   L<name/"sec">      section in other manual page
  219.                   L<"sec">          section in this manual page
  220.                           (the quotes are optional)
  221.                   L</"sec">          ditto
  222.               same as above    but only 'text'    is used    for output.
  223.               (Text    can not    contain    the characters '|' or '>')
  224.                   L<text|name>
  225.                   L<text|name/ident>
  226.                   L<text|name/"sec">
  227.                   L<text|"sec">
  228.                   L<text|/"sec">
  229.  
  230.           F<file>      Used for filenames
  231.           X<index>      An index entry
  232.           Z<>      A zero-width character
  233.           E<escape>      A named character (very similar to HTML escapes)
  234.                   E<lt>          A literal <
  235.                   E<gt>          A literal >
  236.                   (these are optional except in other interior
  237.                    sequences and when preceded by a    capital    letter)
  238.                   E<n>          Character number n (probably in ASCII)
  239.                   E<html>          Some non-numeric HTML    entity,    such
  240.                           as E<Agrave>
  241.  
  242.  
  243.       TTTThhhheeee IIIInnnntttteeeennnntttt
  244.  
  245.       That's it.  The intent is simplicity,    not power.  I wanted
  246.       paragraphs to    look like paragraphs (block format), so    that
  247.       they stand out visually, and so that I could run them
  248.       through fmt easily to    reformat them (that's F7 in my version
  249.       of vvvviiii).  I wanted the    translator (and    not me)    to worry about
  250.       whether " or ' is a left quote or a right quote within
  251.       filled text, and I wanted it to leave    the quotes alone,
  252.       dammit, in verbatim mode, so I could slurp in    a working
  253.       program, shift it over 4 spaces, and have it print out, er,
  254.       verbatim.  And presumably in a constant width    font.
  255.  
  256.       In particular, you can leave things like this    verbatim in
  257.       your text:
  258.  
  259.  
  260.  
  261.      Page 4                        (printed 10/23/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))        PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))
  269.  
  270.  
  271.  
  272.           Perl
  273.           FILEHANDLE
  274.           $variable
  275.           function()
  276.           manpage(3r)
  277.  
  278.       Doubtless a few other    commands or sequences will need    to be
  279.       added    along the way, but I've    gotten along surprisingly well
  280.       with just these.
  281.  
  282.       Note that I'm    not at all claiming this to be sufficient for
  283.       producing a book.  I'm just trying to    make an    idiot-proof
  284.       common source    for nroff, TeX,    and other markup languages, as
  285.       used for online documentation.  Translators exist for
  286.       ppppoooodddd2222mmmmaaaannnn  (that's for _n_r_o_f_f(1)    and _t_r_o_f_f(1)), ppppoooodddd2222tttteeeexxxxtttt,
  287.       ppppoooodddd2222hhhhttttmmmmllll, ppppoooodddd2222llllaaaatttteeeexxxx, and ppppoooodddd2222ffffmmmm.
  288.  
  289.       EEEEmmmmbbbbeeeeddddddddiiiinnnngggg PPPPooooddddssss iiiinnnn PPPPeeeerrrrllll MMMMoooodddduuuulllleeeessss
  290.  
  291.       You can embed    pod documentation in your Perl scripts.     Start
  292.       your documentation with a "=head1" command at    the beginning,
  293.       and end it with a "=cut" command.  Perl will ignore the pod
  294.       text.     See any of the    supplied library modules for examples.
  295.       If you're going to put your pods at the end of the file, and
  296.       you're using an __END__ or __DATA__ cut mark,    make sure to
  297.       put an empty line there before the first pod directive.
  298.  
  299.           __END__
  300.  
  301.           =head1 NAME
  302.  
  303.           modern - I am a modern module
  304.  
  305.       If you had not had that empty    line there, then the
  306.       translators wouldn't have seen it.
  307.  
  308.       CCCCoooommmmmmmmoooonnnn PPPPoooodddd PPPPiiiittttffffaaaallllllllssss
  309.  
  310.       +o   Pod translators usually will require paragraphs to be
  311.           separated    by completely empty lines.  If you have    an
  312.           apparently empty line with some spaces on    it, this can
  313.           cause odd    formatting.
  314.  
  315.       +o   Translators will mostly add wording around a L<> link,
  316.           so that L<foo(1)>    becomes    "the _f_o_o(1) manpage", for
  317.           example (see ppppoooodddd2222mmmmaaaannnn for details).  Thus,    you shouldn't
  318.           write things like    the L<foo> manpage, if you want    the
  319.           translated document to read sensibly.
  320.  
  321.           If you don need or want total control of the text    used
  322.           for a link in the    output use the form L<show this
  323.           text|foo>    instead.
  324.  
  325.  
  326.  
  327.      Page 5                        (printed 10/23/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))        PPPPEEEERRRRLLLLPPPPOOOODDDD((((1111))))
  335.  
  336.  
  337.  
  338.       +o   The script _p_o_d/_c_h_e_c_k_p_o_d_s._P_L in the Perl source
  339.           distribution provides skeletal checking for lines    that
  340.           look empty but aren't oooonnnnllllyyyy, but is there as a
  341.           placeholder until    someone    writes Pod::Checker.  The best
  342.           way to check your    pod is to pass it through one or more
  343.           translators and proofread    the result, or print out the
  344.           result and proofread that.  Some of the problems found
  345.           may be bugs in the translators, which you    may or may not
  346.           wish to work around.
  347.  
  348.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  349.       the _p_o_d_2_m_a_n manpage and the section on _P_O_D_s: _E_m_b_e_d_d_e_d
  350.       _D_o_c_u_m_e_n_t_a_t_i_o_n    in the _p_e_r_l_s_y_n manpage
  351.  
  352.      AAAAUUUUTTTTHHHHOOOORRRR
  353.       Larry    Wall
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                        (printed 10/23/98)
  394.  
  395.  
  396.  
  397.